Optimal. Leaf size=138 \[ \frac {a \left (a^2-6 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac {1}{2} b x \left (6 a^2-b^2\right )+\frac {15 a b^2 \cos (c+d x)}{2 d}-\frac {3 b \cot (c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac {\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{2 d}+\frac {5 b^3 \sin (c+d x) \cos (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.47, antiderivative size = 138, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.259, Rules used = {2889, 3048, 3047, 3033, 3023, 2735, 3770} \[ \frac {a \left (a^2-6 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac {1}{2} b x \left (6 a^2-b^2\right )+\frac {15 a b^2 \cos (c+d x)}{2 d}-\frac {3 b \cot (c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac {\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{2 d}+\frac {5 b^3 \sin (c+d x) \cos (c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2735
Rule 2889
Rule 3023
Rule 3033
Rule 3047
Rule 3048
Rule 3770
Rubi steps
\begin {align*} \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x))^3 \, dx &=\int \csc ^3(c+d x) (a+b \sin (c+d x))^3 \left (1-\sin ^2(c+d x)\right ) \, dx\\ &=-\frac {\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{2 d}+\frac {1}{2} \int \csc ^2(c+d x) (a+b \sin (c+d x))^2 \left (3 b-a \sin (c+d x)-4 b \sin ^2(c+d x)\right ) \, dx\\ &=-\frac {3 b \cot (c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac {\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{2 d}+\frac {1}{2} \int \csc (c+d x) (a+b \sin (c+d x)) \left (-a^2+6 b^2-5 a b \sin (c+d x)-10 b^2 \sin ^2(c+d x)\right ) \, dx\\ &=\frac {5 b^3 \cos (c+d x) \sin (c+d x)}{2 d}-\frac {3 b \cot (c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac {\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{2 d}+\frac {1}{4} \int \csc (c+d x) \left (-2 a \left (a^2-6 b^2\right )-2 b \left (6 a^2-b^2\right ) \sin (c+d x)-30 a b^2 \sin ^2(c+d x)\right ) \, dx\\ &=\frac {15 a b^2 \cos (c+d x)}{2 d}+\frac {5 b^3 \cos (c+d x) \sin (c+d x)}{2 d}-\frac {3 b \cot (c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac {\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{2 d}+\frac {1}{4} \int \csc (c+d x) \left (-2 a \left (a^2-6 b^2\right )-2 b \left (6 a^2-b^2\right ) \sin (c+d x)\right ) \, dx\\ &=-\frac {1}{2} b \left (6 a^2-b^2\right ) x+\frac {15 a b^2 \cos (c+d x)}{2 d}+\frac {5 b^3 \cos (c+d x) \sin (c+d x)}{2 d}-\frac {3 b \cot (c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac {\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{2 d}-\frac {1}{2} \left (a \left (a^2-6 b^2\right )\right ) \int \csc (c+d x) \, dx\\ &=-\frac {1}{2} b \left (6 a^2-b^2\right ) x+\frac {a \left (a^2-6 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{2 d}+\frac {15 a b^2 \cos (c+d x)}{2 d}+\frac {5 b^3 \cos (c+d x) \sin (c+d x)}{2 d}-\frac {3 b \cot (c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac {\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.31, size = 192, normalized size = 1.39 \[ \frac {a^3 \left (-\csc ^2\left (\frac {1}{2} (c+d x)\right )\right )+a^3 \sec ^2\left (\frac {1}{2} (c+d x)\right )-4 a^3 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+4 a^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+12 a^2 b \tan \left (\frac {1}{2} (c+d x)\right )-12 a^2 b \cot \left (\frac {1}{2} (c+d x)\right )-24 a^2 b c-24 a^2 b d x+24 a b^2 \cos (c+d x)+24 a b^2 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-24 a b^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+2 b^3 \sin (2 (c+d x))+4 b^3 c+4 b^3 d x}{8 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.75, size = 216, normalized size = 1.57 \[ \frac {12 \, a b^{2} \cos \left (d x + c\right )^{3} - 2 \, {\left (6 \, a^{2} b - b^{3}\right )} d x \cos \left (d x + c\right )^{2} + 2 \, {\left (6 \, a^{2} b - b^{3}\right )} d x + 2 \, {\left (a^{3} - 6 \, a b^{2}\right )} \cos \left (d x + c\right ) - {\left (a^{3} - 6 \, a b^{2} - {\left (a^{3} - 6 \, a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + {\left (a^{3} - 6 \, a b^{2} - {\left (a^{3} - 6 \, a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 2 \, {\left (b^{3} \cos \left (d x + c\right )^{3} + {\left (6 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.30, size = 272, normalized size = 1.97 \[ \frac {a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 12 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 4 \, {\left (6 \, a^{2} b - b^{3}\right )} {\left (d x + c\right )} - 4 \, {\left (a^{3} - 6 \, a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + \frac {2 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 12 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 12 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 8 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 24 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 24 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 8 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 36 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a^{3}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}^{2}}}{8 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.50, size = 171, normalized size = 1.24 \[ -\frac {a^{3} \left (\cos ^{3}\left (d x +c \right )\right )}{2 d \sin \left (d x +c \right )^{2}}-\frac {a^{3} \cos \left (d x +c \right )}{2 d}-\frac {a^{3} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2 d}-3 a^{2} b x -\frac {3 a^{2} b \cot \left (d x +c \right )}{d}-\frac {3 a^{2} b c}{d}+\frac {3 a \,b^{2} \cos \left (d x +c \right )}{d}+\frac {3 a \,b^{2} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}+\frac {b^{3} \cos \left (d x +c \right ) \sin \left (d x +c \right )}{2 d}+\frac {b^{3} x}{2}+\frac {b^{3} c}{2 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.50, size = 128, normalized size = 0.93 \[ -\frac {12 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a^{2} b - {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} b^{3} - a^{3} {\left (\frac {2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} + \log \left (\cos \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 6 \, a b^{2} {\left (2 \, \cos \left (d x + c\right ) - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{4 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 9.46, size = 585, normalized size = 4.24 \[ \frac {a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}+\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (3\,a\,b^2-\frac {a^3}{2}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (6\,a^2\,b+4\,b^3\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (24\,a\,b^2-\frac {a^3}{2}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (24\,a\,b^2-a^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (12\,a^2\,b-4\,b^3\right )+\frac {a^3}{2}+6\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}+\frac {3\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}+\frac {b\,\mathrm {atan}\left (\frac {\frac {b\,\left (6\,a^2-b^2\right )\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (6\,a\,b^2-a^3\right )-6\,a^2\,b+b^3-b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (6\,a^2-b^2\right )\,3{}\mathrm {i}\right )}{2}+\frac {b\,\left (6\,a^2-b^2\right )\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (6\,a\,b^2-a^3\right )-6\,a^2\,b+b^3+b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (6\,a^2-b^2\right )\,3{}\mathrm {i}\right )}{2}}{2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (36\,a^4\,b^2-12\,a^2\,b^4+b^6\right )+6\,a\,b^5+6\,a^5\,b-37\,a^3\,b^3-\frac {b\,\left (6\,a^2-b^2\right )\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (6\,a\,b^2-a^3\right )-6\,a^2\,b+b^3-b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (6\,a^2-b^2\right )\,3{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}+\frac {b\,\left (6\,a^2-b^2\right )\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (6\,a\,b^2-a^3\right )-6\,a^2\,b+b^3+b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (6\,a^2-b^2\right )\,3{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}}\right )\,\left (6\,a^2-b^2\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________